<?php

namespace Models;

/**
 *
 * @author Evgeny Baranov <evgeny@baranov.eu>
 *
 */
class ArticleContent extends Base {
    protected $article_id;
    protected $language_code;
    protected $path;
    protected $title;
    protected $annotation;
    protected $content;

    /**
     * @return array
     */
    public function toArray() {
        return array(
            'article_id' => $this->article_id,
            'language_code' => $this->language_code,
            'path' => $this->path,
            'title' => $this->title,
            'content' => $this->content,
            'annotation' => $this->annotation
        );
    }

    /**
     * @param array $data
     * @return ArticleContent
     */
    public function fromArray($data) {
        $data['content'] = stripslashes($data['content']);
        $data['annotation'] = stripslashes($data['annotation']);

        return parent::fromArray($data);
    }

    public function getTitle() {
        return $this->title;
    }

    public function getContent() {
        return $this->content;
    }

    public function getAnnotation() {
        return $this->annotation;
    }

    public function getPath() {
        return $this->path;
    }

    public function getLanguageCode() {
        return $this->language_code;
    }
}
